package com.abel;

public class TestMyProxy {
	public static void main(String[] args) {

		Service target = new MyService();
		try {
			//通过代理类获取Service的代理类
			Service proxy = (Service) MyProxy.getInstance(target);
			//执行Service的方法，结果会打印“log”，说明代理成功。
			proxy.print();
		} catch (Exception e) {
			e.printStackTrace();
		}

	}


}
